package lianxi;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class lianxitest2 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,1,1,1,1,1,1,1);
        Collections.addAll(list,0,0,0);

        Random r = new Random();
        int index = r.nextInt(list.size());
        if (list.get(index)==1){
            System.out.println("抽到的是男生");
        }else {
            System.out.println("抽到的是女生");
        }
    }
}
